package com.xucy.springboot.annotationaop;

import com.xucy.springboot.entity.ResultMsg;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xucy
 * @Date 2019-07-31 17:55
 * @Description
 **/

@RestController
@RequestMapping("/testCon")
public class TestController {



    @LogAnnotation(operatorUser="1",operatorName = "2",operatorNo = "3",operatorTime = "4")
    @RequestMapping("/test1")
    public ResultMsg test1(@RequestBody  User user){
        ResultMsg resultMsg=new ResultMsg();


        return resultMsg;
    }

    @LogAnnotation(operatorUser="11",operatorName = "22",operatorNo = "33",operatorTime = "44")
    @RequestMapping("/test2")
    public ResultMsg test2(@RequestBody  User user){
        ResultMsg resultMsg=new ResultMsg();
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        return resultMsg;
    }

    @LogAnnotation()
    @RequestMapping("/test3")
    public ResultMsg test3(@RequestBody  User user){
        ResultMsg resultMsg=new ResultMsg();


        return resultMsg;
    }
}
